<template>
	<view class="content">
		<image class="bg" src="@/static/nuoyu-login/nuoyu-login-bg.png" mode="aspectFill"></image>
		
		<view class="loginBg">
			<view class="loginContent">
				<view class="Title">
					{{status?'注册账号':'登录模式'}}
				</view>
			</view>
			
			<view class="InputName">
				<view class="Icon">
					<u-icon size="28" name="account"></u-icon>
				</view>
				<view class="Input">
					<input v-model="userInfo.phone" placeholder="请输入账号" style="font-size: 32rpx;" type="text" />
				</view>
			</view>
			
			<view class="InputName" style="margin-top: 26rpx;">
				<view class="Icon">
					<u-icon size="28" name="lock"></u-icon>
				</view>
				<view class="Input">
					<input v-model="userInfo.password" placeholder="请输入密码" style="font-size: 32rpx;" type="password" />
				</view>
			</view>
		</view>
		
		<view class="Btn-box">
			<view class="Btn" @click="Login">
				登录账号
			</view>
			<view class="Btn" @click="Register">
				{{status?'返回登录':'注册账号'}}
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo:{
					phone:'',
					password:''
				},
				status:false, // false登录模式 ture注册模式
				
			}
		},
		onLoad() {

		},
		methods: {
			Login(){
				this.$emit('login',this.userInfo,this.status)
			},
			Register(){
				this.status = !this.status
			}
		}
	}
</script>

<style scoped lang="scss">
	.content{
		font-family:"楷体";
		position: relative;
		height: 100vh;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		
		.bg{
			animation: float 5s ease-in-out infinite;
			position: absolute;
			height: 100%;
			width: 100%;
			
		}
		@keyframes float {
		    from {
		        transform: translatey(0px) scale(1);
		    }
		
		    50% {
		        transform: translatey(-3px) scale(1.03);
		    }
		
		    to {
		        transform: translatey(0px) scale(1);
		    }
		}
		.loginBg{
			border-radius: 16rpx;
			z-index: 1;
			width: 80%;
			height: 400rpx;
			box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.2);
			background-color:rgba(255,255,255,0.8);   // 透明背景
			.loginContent{
				height: 100rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				.Title{
					// animation: float 3s ease-in-out infinite;
					font-size: 34rpx;
					font-weight: 700;
				}
				
			}
			.InputName{
				display: flex;
				align-items: center;
				justify-content: center;
				gap: 20rpx;
				.Icon{
					
				}
				.Input{
					border-bottom:1rpx solid #666;
					padding: 10rpx 20rpx;
				}
			}
		}
		.Btn-box{
			z-index: 1;
			position: relative;
			bottom: 120rpx;
			display: flex;
			gap: 20rpx;
			.Btn{
				
				border-radius: 16rpx;
				padding: 15rpx 45rpx;
				box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.2);
				background-color:rgba(255,255,255,0.8);   // 透明背景
			}
			.Btn:active{
				box-shadow: 5px 5px 0px 0px rgba(28, 66, 150, 0.2);
				background-color: rgba(28, 66, 150, 0.1);
				
			}
		}
		
		
	}
</style>
